﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="BUserM.aspx.cs" Inherits="BUserM" MaintainScrollPositionOnPostback="true"
    EnableEventValidation="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>用户管理</title>
    <link href="../../CSS/SubStyle.css" rel="stylesheet" type="text/css" />
    <style type="text/css">#newPreview{ 
        FILTER: progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale) 
    } 
    </style>
    <script type="text/javascript" src="../../Jscript/wyyjs.js"></script><%--
    <script type="text/javascript" src="../../Jscript/JSunwen.js"></script>--%>
    <script type="text/javascript" language="javascript">
    function boundvalid()
    {
        boundsource("txtCode","^.+$","员工编号不能为空","cmdAdd,cmdEdit");
        boundsource("txtLogin","^.+$","用户名不能为空","cmdAdd,cmdEdit");
        boundsource("txtEname","^.+$","用户英文名不能为空","cmdAdd,cmdEdit");
        boundsource("txtName","^.+$","用户中文名不能为空","cmdAdd,cmdEdit");
       boundsource("txtEmail","^.+$","邮箱不能为空","cmdAdd,cmdEdit"); 
    }
    </script>
</head>
<body onload="boundvalid();">
    <form id="form1" runat="server">
        <div>
            <table cellpadding="0" cellspacing="0" class="topTable">
                <tr>
                    <td class="topTd">
                        <asp:Label ID="lblLocation" runat="server" Text="<%$ Resources:language, Location %>"></asp:Label><img
                            alt="当前位置" src="../../Image/weizhi.gif" />>><asp:Label ID="Label1" runat="server" Text="<%$ Resources:Title, UserInfo %>"></asp:Label><asp:Label
                                ID="Label2" runat="server" Text="<%$ Resources:language, Must1 %>"></asp:Label><font
                                    color="#ff0000">*</font><asp:Label ID="Label3" runat="server" Text="<%$ Resources:language, Must2 %>"></asp:Label>
                    </td>
                </tr>
            </table>
            <fieldset>
                <legend><font style="font-size: 12px">
                    <asp:Label ID="lblLegend1" runat="server" Text="<%$ Resources:language, Legend1 %>"></asp:Label></font></legend>
                 <table cellpadding="0" cellspacing="0" style="width: 100%; height: 100%;" class="topTdInput">
                                <tr>
                                    <td style="height: 5px;" class="td10">
                                    </td>
                                </tr>
                                <tr>
                                    <td class="td10">
                                    </td>
                                    <td class="td20">
                                    </td>
                                    <td class="td10">
                                    </td>
                                    <td class="td20">
                                    </td>
                                    <td class="td10">
                                    </td>
                                    <td class="td20">
                                    </td>
                                    <td>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="td10">
                                        <font color="#ff0000">*</font><asp:Label ID="Label4" runat="server" Text="<%$ Resources:language, StaffNo %>"></asp:Label>:</td>
                                    <td class="td20">
                                        <asp:TextBox ID="txtCode" CssClass="txtStyle" runat="server"></asp:TextBox>
                                    </td>
                                    <td class="td10">
                                        <font color="#ff0000">*</font><asp:Label ID="Label5" runat="server" Text="<%$ Resources:language, UserName %>"></asp:Label>:
                                    </td>
                                    <td class="td20">
                                        <asp:TextBox ID="txtLogin" runat="server" CssClass="txtStyle"></asp:TextBox>
                                    </td>
                                    <td class="td10">
                                        <asp:Label ID="Label6" runat="server" Text="<%$ Resources:language, EName %>"></asp:Label>:
                                    </td>
                                    <td class="td20">
                                        <asp:TextBox ID="txtEname" runat="server" CssClass="txtStyle"></asp:TextBox>
                                    </td>
                                    <td>
                                        </td>
                                </tr>
                                <tr>
                                    <td class="td10">
                                        <span style="color: #ff0000">*</span>
                                        <asp:Label ID="Label7" runat="server" Text="<%$ Resources:language, FullName %>"></asp:Label>:</td>
                                    <td class="td20">
                                        <asp:TextBox ID="txtName" runat="server" CssClass="txtStyle"></asp:TextBox></td>
                                    <td class="td10">
                                        <asp:Label ID="Label8" runat="server" Text="<%$ Resources:language, PWD %>"></asp:Label>:</td>
                                    <td class="td20">
                                        <asp:TextBox ID="txtPwd" TextMode="password" CssClass="txtStyle" runat="server"></asp:TextBox></td>
                                    <td class="td10">
                                        <asp:Label ID="Label9" runat="server" Text="<%$ Resources:language, CPWD %>"></asp:Label>:</td>
                                    <td class="td20">
                                        <asp:TextBox ID="txtSure" TextMode="password" CssClass="txtStyle" runat="server"></asp:TextBox></td>
                                    <td align="left">
                                        &nbsp;&nbsp;
                                        <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="txtPwd"
                                            ControlToValidate="txtSure" ErrorMessage="密码不一致"></asp:CompareValidator></td>
                                </tr>
                                <tr>
                                    <td class="td10">
                                        <asp:Label ID="Label12" runat="server" Text="<%$ Resources:language, UserTitle %>"></asp:Label>:&nbsp;</td>
                                    <td class="td20">
                                        <asp:TextBox ID="txtLevel" runat="server" CssClass="txtStyle"></asp:TextBox></td>
                                    <td class="td10" >
                                        <asp:Label ID="Label18" runat="server" Text="<%$ Resources:language, DomainName %>"></asp:Label>:&nbsp;</td>
                                    <td class="td20">
                                        <asp:TextBox ID="txtDomain" CssClass="txtStyle" runat="server"></asp:TextBox></td>
                                    <td class="td10">
                                        <span style="color: #ff0000">*</span>
                                        <asp:Label ID="Label16" runat="server" Text="<%$ Resources:language, UserStatus %>"></asp:Label>:
                                    </td>
                                    <td class="td20">
                                        <asp:DropDownList ID="ddlStatus" runat="server" CssClass="txtStyle" Width="102%">
                                            <asp:ListItem Value="0">启用-Active</asp:ListItem>
                                            <asp:ListItem Value="1">停用-Inactive</asp:ListItem>
                                        </asp:DropDownList></td>
                                    <td>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="td10">
                                        <span style="color: #ff0000">*</span>
                                        <asp:Label ID="Label17" runat="server" Text="<%$ Resources:language, EmailAddress %>"></asp:Label>:&nbsp;</td>
                                    <td class="td20">
                                        <asp:TextBox ID="txtEmail" CssClass="txtStyle" runat="server"></asp:TextBox></td>
                                    <td class="td10">
                                        <asp:Label ID="Label14" runat="server" Text="<%$ Resources:language, BackupEmail %>"></asp:Label>:&nbsp;</td>
                                    <td class="td20">
                                        <asp:TextBox ID="txtBackupEmail" CssClass="txtStyle" runat="server"></asp:TextBox></td>
                                    <td class="td10">
                                        <asp:Label ID="Label13" runat="server" Text="<%$ Resources:language, LegalEntity %>"></asp:Label>:&nbsp;</td>
                                    <td class="td20">
                                        <asp:TextBox ID="txtLegal" runat="server" CssClass="txtStyle"></asp:TextBox></td>
                                    <td>
                                        &nbsp;</td>
                                </tr>
                                <tr>
                                    <td class="td10">
                                    </td>
                                    <td class="td20">
                                    </td>
                                    <td class="td10">
                                    </td>
                                    <td class="td20">
                                    </td>
                                    <td class="td10">
                                    </td>
                                    <td class="td20">
                                    </td>
                                    <td>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="height: 5px;" class="td10">
                                    </td>
                                </tr>
                            </table>
               <div style="height:3px"></div> 
                <div class="cmdButtonsDiv">
                    <asp:Button ID="btnSelect" runat="server" CssClass="cmdStyle" OnClick="btnSelect_Click"
                        Text="<%$ Resources:language, CmdSearch %>" />
                    &nbsp;<asp:Button ID="cmdAdd" runat="server" Text="<%$ Resources:language, CmdAdd %>"
                        CssClass="cmdStyle" OnClick="cmdAdd_Click" />
                    &nbsp;<asp:Button ID="cmdEdit" runat="server" Text="<%$ Resources:language, CmdEdit %>"
                        CssClass="cmdStyle" Enabled="False" OnClick="cmdEdit_Click" />
                    <asp:Button ID="cmdExport" CssClass="cmdStyle" runat="server" Text="<%$ Resources:hwlan, eaex%>"
                        OnClick="cmdExport_Click" Visible="False" />
                    <input id="cmdClear" class="cmdStyle" type="button" runat="server" value="<%$ Resources:language, CmdClear %>"
                        onserverclick="cmdClear_ServerClick" />
                </div>
               <div style="height:3px"></div>  
            </fieldset>
            <fieldset>
                <legend><font style="font-size: 12px">
                    <asp:Label ID="lblLegend2" runat="server" Text="<%$ Resources:language, Legend2 %>"></asp:Label></font></legend>
                <div style="width: 100%; overflow-y: hidden; overflow-x: auto;">
                    <asp:GridView ID="gvUsers" runat="server" AutoGenerateColumns="False" CssClass="gvStyle"
                        AllowPaging="True" PageSize="15" GridLines="None" OnRowDeleting="gvUsers_RowDeleting"
                        OnRowDataBound="gvUsers_RowDataBound" OnPageIndexChanging="gvUsers_PageIndexChanging"
                        OnRowEditing="gvUsers_RowEditing" OnSelectedIndexChanged="gvUsers_SelectedIndexChanged"
                        Width="100%" AllowSorting="True" OnSorting="gvUsers_Sorting" 
                        OnRowCommand="gvUsers_RowCommand">
                        <HeaderStyle CssClass="gvHeader" />
                        <RowStyle CssClass="gvRow" />
                        <AlternatingRowStyle CssClass="gvAllRow" />
                        <Columns>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    NO.</HeaderTemplate>
                                <ItemTemplate>
                                    <%#gvUsers.PageIndex * gvUsers.PageSize + gvUsers.Rows.Count + 1%>
                                </ItemTemplate>
                                <ItemStyle CssClass="gvItem" />
                            </asp:TemplateField>
                            <asp:BoundField DataField="UserCode" HeaderText="<%$ Resources:language, StaffNo %>"
                                SortExpression="UserCode">
                                <ItemStyle CssClass="gvItem" />
                            </asp:BoundField>
                            <asp:BoundField DataField="USERNAME" HeaderText="<%$ Resources:language, UserName %>"
                                SortExpression="username">
                                <ItemStyle CssClass="gvItem" />
                            </asp:BoundField>
                            <asp:BoundField DataField="UserEngName" HeaderText="<%$ Resources:language, EName %>">
                                <ItemStyle CssClass="gvItem" />
                            </asp:BoundField>
                            <asp:BoundField DataField="USERFULLNAME" HeaderText="<%$ Resources:language, FullName %>"
                                SortExpression="USERFULLNAME">
                                <ItemStyle CssClass="gvItem" />
                            </asp:BoundField>
                            <asp:BoundField DataField="UserPost" HeaderText="<%$ Resources:language, UserTitle %>">
                                <ItemStyle CssClass="gvItem" />
                            </asp:BoundField>
                            <asp:BoundField DataField="LawEntity" HeaderText="<%$ Resources:language, LegalEntity %>">
                                <ItemStyle CssClass="gvItem" />
                            </asp:BoundField>
                            <asp:BoundField DataField="DeleteFlag" HeaderText="<%$ Resources:language, UserStatus %>">
                                <ItemStyle CssClass="gvItem" />
                            </asp:BoundField>
                            <asp:BoundField DataField="email" HeaderText="<%$ Resources:language, EmailAddress %>">
                                <ItemStyle CssClass="gvItem" />
                            </asp:BoundField>
                            <asp:BoundField DataField="domainName" HeaderText="<%$ Resources:language, DomainName %>">
                                <ItemStyle CssClass="gvItem" />
                            </asp:BoundField>
                            <asp:CommandField HeaderText="<%$ Resources:language, Edit %>" ShowSelectButton="true"
                                SelectText="&lt;img border=0 alt=&quot;Edit&quot; src=../../Image/edit.gif&gt;">
                                <ItemStyle CssClass="gvItem" />
                            </asp:CommandField>
                            <asp:CommandField ShowDeleteButton="True" DeleteText="&lt;img border=0 alt=&quot;Delete&quot; src=../../Image/del.gif&gt;"
                                HeaderText="<%$ Resources:language, Delete  %>">
                                <ItemStyle CssClass="gvItem" />
                            </asp:CommandField>
                                    <asp:CommandField ShowEditButton="True" EditText="&lt;img border=0 alt=Reset src=../../Image/reset.gif&gt;"
                                        HeaderText="<%$ Resources:language, CmdClear %>">
                                        <ItemStyle CssClass="gvItem" />
                                    </asp:CommandField>
                        </Columns>
                        <PagerTemplate>
                            <table style="width: 100%;">
                                <tr>
                                    <td align="left">
                                        <asp:Label ID="lblTotal1" runat="server" Text="<%$ Resources:UserSqlPage, Total1 %>"></asp:Label><asp:Label
                                            ID="lblCount" runat="server"></asp:Label><asp:Label ID="Total2" runat="server" Text="<%$ Resources:UserSqlPage, Total2 %>"></asp:Label>,<asp:Label
                                                ID="Label5" runat="server" Text="<%$ Resources:UserSqlPage, CurrentPage1 %>"></asp:Label><asp:Label
                                                    ID="lblPageIndex" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageIndex + 1 %>' /><asp:Label
                                                        ID="Label11" runat="server" Text="<%$ Resources:UserSqlPage, CurrentPage2 %>"></asp:Label>,<asp:Label
                                                            ID="Label3" runat="server" Text="<%$ Resources:UserSqlPage, TotalPage1 %>"></asp:Label><asp:Label
                                                                ID="lblPageCount" runat="server" Text='<%# ((GridView)Container.Parent.Parent).PageCount  %>' /><asp:Label
                                                                    ID="Label12" runat="server" Text="<%$ Resources:UserSqlPage, TotalPage2 %>"></asp:Label>
                                        <% //首页/上一页 %>
                                        <% if (this.gvUsers.PageIndex <= 0)
                                           { %>
                                        <asp:LinkButton ID="LinkButton1" runat="server" Enabled="false" Text="<%$ Resources:UserSqlPage, FirstPage %>" />&nbsp;
                                        <asp:LinkButton ID="LinkButton2" runat="server" Enabled="false" Text="<%$ Resources:UserSqlPage, PreviousPage %>" />&nbsp;
                                        <% }
                                           else
                                           { %>
                                        <asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="False" CommandArgument="First"
                                            CommandName="Page" Text="<%$ Resources:UserSqlPage, FirstPage %>" />&nbsp;
                                        <asp:LinkButton ID="LinkButton4" runat="server" CausesValidation="False" CommandArgument="Prev"
                                            CommandName="Page" Text="<%$ Resources:UserSqlPage, PreviousPage %>" />&nbsp;
                                        <% } %>
                                        <% //下一页/尾页 %>
                                        <% if (this.gvUsers.PageIndex >= gvUsers.PageCount - 1)
                                           { %>
                                        <asp:LinkButton ID="LinkButton5" runat="server" Enabled="false" Text="<%$ Resources:UserSqlPage, NextPage %>" />&nbsp;
                                        <asp:LinkButton ID="LinkButton6" runat="server" Enabled="false" Text="<%$ Resources:UserSqlPage, LastPage %>" />
                                        <% }
                                           else
                                           { %>
                                        <asp:LinkButton ID="LinkButton7" runat="server" CausesValidation="False" CommandArgument="Next"
                                            CommandName="Page" Text="<%$ Resources:UserSqlPage, NextPage %>" />&nbsp;
                                        <asp:LinkButton ID="LinkButton8" runat="server" CausesValidation="False" CommandArgument="Last"
                                            CommandName="Page" Text="<%$ Resources:UserSqlPage, LastPage %>" />
                                        <% } %>
                                        <asp:TextBox ID="txtNewPageIndex" runat="server" Text="<%# ((GridView)Container.Parent.Parent).PageIndex + 1%>"
                                            Width="20px"></asp:TextBox>
                                        <asp:LinkButton ID="btnGo" runat="server" CausesValidation="False" CommandArgument="-1"
                                            CommandName="NewPage" Text="<%$ Resources:UserSqlPage, PageGo %>"></asp:LinkButton>
                                    </td>
                                </tr>
                            </table>
                        </PagerTemplate>
                    </asp:GridView>
                </div>
            </fieldset>    
        </div>
    </form>
</body>
</html>
